import {
  createWebHistory,
  createRouter
} from 'vue-router'

export const constantRoutes = [{
  path: '/index',
  component: () => import('../views/index.vue'),
  meta: {
    title: "登录"
  },
  hidden: true
},
{
  path: "/",
  redirect: "/index",
},
];

const router = new createRouter({
  history: createWebHistory(),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        top: 0
      }
    }
  },
});

export default router;